package main

import (
	"github.com/gogf/gf/v2/container/garray"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/ghttp"
)

func main() {
	serv := g.Server()
	serv.BindHandler("/", func(r *ghttp.Request) {
		r.Response.Write("Hello World!")
	})
	serv.BindHandler("/:name/*act/{class}", func(r *ghttp.Request) {
		r.Response.WriteJson(garray.NewArray().Append(r.Get("name"), r.Get("act"), r.Get("class")))
		//r.Response.Writef("%v %v %v", r.Get("name"), r.Get("act"), r.Get("class"))
	})
	//serv.SetPort(8000)
	serv.Run()
}
